package com.google.code.virtualhockey.vhx.server.servlet.rpc

import javax.servlet.http.{HttpServletRequest, HttpServletResponse}
import com.google.gwt.user.server.rpc.RemoteServiceServlet

/**
 * Provides the means to create a new CommandContext.
 */
trait TCommandContextProvider {
  /**
   * Creates a new {@link CommandContext}.
   *
   * @param servletParent the parent servlet which asks to create a new context
   * @param rq the current servlet request
   * @param rp the current servlet response
   * @return the new CommandContext
   * @throws GDTWebServerException in case the context creation fails
   */
  def createContext( servletParent: RemoteServiceServlet, rq: HttpServletRequest, rp: HttpServletResponse ): CommandContext
}
